package com.ymatou.app.home.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.home.service.GetBannerListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
/**
*获取Banner列表接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetBannerList{
	private static GetBannerListCall getbannerlistCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取Banner列表接口");
	}

	@Before
	public void caseUp() {
		getbannerlistCall=new GetBannerListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getbannerlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBannerList_001() {
		Logger.start(true,"获取Banner列表成功");
		try {
			getbannerlistCall.callService();			
			Logger.comment("getbannerlistCall send:" + getbannerlistCall.getEntityString());
			Logger.comment("getbannerlistCall response:" + getbannerlistCall.getReturnData());
			
			Logger.verifyEquals(5, getbannerlistCall.getBanner().length(), "验证返回数据list为5");		
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}